/* 1742. 盒子中小球的最大数量 */
/**
 * @param {number} lowLimit
 * @param {number} highLimit
 * @return {number}
 */
var countBalls = function (lowLimit, highLimit) {
	const map = new Map()
	let ans = 0
	for (let i = lowLimit; i <= highLimit; i++) {
		let box = 0,
			x = i
		while (x !== 0) {
			box += x % 10
			x = Math.floor(x / 10)
		}
		map.set(box, (map.get(box) || 0) + 1)
		ans = Math.max(ans, map.get(box))
	}
	return ans
}
countBalls(1, 1000)
